home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_aibruiser.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  132 lines

  1. # ===================================================================
  2. # Jones 3D Cog Script
  3. #
  4. # actor_AIBruiser.cog
  5. #
  6. # [MDR] [RT]
  7. #
  8. # Actor script for Bruiser AI's.
  9. #
  10. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. message        created
  16. message        timer
  17. message        damaged
  18. message        killed
  19.  
  20. # ************************** TEMPLATES *************************
  21. template    tplFire=+bazooka_exp_fire    local
  22. template    tplSmoke=+bazooka_exp_smoke    local
  23. template    tplSparks=lavadeathsparks    local
  24.  
  25. # ************************** WEAPON HANDLERS *******************
  26. int            weaponNum=23                local
  27.  
  28. # ************************** MISC LOCAL VARS *******************
  29. thing        bandito                        local
  30. int            index                        local
  31. int            damageType                    local
  32. int            TIMER_ID_WAKEUP_AND_DIE=1    local
  33. int            timerID                        local 
  34.  
  35. end
  36.  
  37. # ===================================================================
  38. code
  39.  
  40. # -------------------------------------------------------------------
  41. created:
  42.  
  43.     bandito = GetSenderRef();
  44.  
  45.     SetThingFireOffset(bandito, '-0.005 0.05 0.008');
  46.     SetWeaponModel(bandito, weaponNum);
  47.     SelectWeapon(bandito, weaponNum);
  48.  
  49.     AIEnableInstinct(bandito, "circlestrafe", 0);
  50.     AIEnableInstinct(bandito, "roam", 0);
  51.  
  52.     return;
  53.  
  54.  
  55. # -------------------------------------------------------------------
  56. timer:
  57.  
  58.     bandito = GetParam(0);
  59.     timerID = GetSenderId();
  60.  
  61.     if (timerID == TIMER_ID_WAKEUP_AND_DIE)
  62.     {
  63.         # Make sure not invulnerable
  64.         ClearActorFlags(bandito, 0x8);
  65.         # Using scrape damage to avoid infinite loop
  66.         DamageThing(bandito, GetThingMaxHealth(bandito), 0x1000000, GetLocalPlayerThing());
  67.     }
  68.  
  69.     return;
  70.  
  71.  
  72. # -------------------------------------------------------------------
  73. damaged:
  74.  
  75.     bandito = GetSenderRef();
  76.     damageType = GetParam(1);
  77.  
  78.     # Jeep or MineCar hit us
  79.     if (damageType == 0x02000000)
  80.     {
  81.         # If invulnerable or immobile, ignore -- avoids multiple collision problem
  82.         if (BITTEST(GetActorFlags(bandito), 0x40008))
  83.         { 
  84.             ReturnEx(0);
  85.             return;
  86.         }
  87.         else if (GetParam(0) >= GetThingHealth(bandito))
  88.         {
  89.             # Get rid of his gun, says Hal...
  90.             ResetWeaponModel(bandito);
  91.  
  92.             # Pause long enough to land
  93.             AIRunOver(bandito, RandBetween(5, 6), TIMER_ID_WAKEUP_AND_DIE);
  94.             ReturnEx(0);
  95.             return;
  96.         }
  97.     }
  98.  
  99.     return;
  100.  
  101.  
  102. # -------------------------------------------------------------------
  103. killed:
  104.  
  105.     bandito = GetSenderRef();
  106.  
  107.     # Killed by lava?
  108.     if (GetParam(1) == 0x200)
  109.     {
  110.         Sleep(0.1);
  111.         CreateThing(tplFire, bandito);
  112.         Sleep(0.3);
  113.         CreateThing(tplSmoke, bandito);
  114.         SetThingFlags(bandito, 0x80000);
  115.  
  116.         for (index = 0; index < 10; index = index + 1)
  117.         {
  118.             CreateThing(tplSparks, bandito);
  119.             Sleep(0.03);
  120.         }
  121.     }
  122.     else
  123.     {
  124.         # Get rid of his gun, says Hal...
  125.         ResetWeaponModel(bandito);
  126.     }
  127.  
  128.     return;
  129.  
  130. end
  131.  
  132.